var EventEmitter = require("events").EventEmitter,
util = require('util'),
settings = require('./../config'),
_ = require("lodash");

var redis = require("redis"),
  bluebird = require("bluebird");

bluebird.promisifyAll(redis.RedisClient.prototype);
bluebird.promisifyAll(redis.Multi.prototype);
var client = redis.createClient({
    host:settings.redis.host,
    port:settings.redis.port,
    db : settings.redis.cachedb,
    password : settings.redis.password,
    prefix : 'ca'
})
let UserManager = require('./userManager');


function Service(){
    EventEmitter.call(this);
    this.client = client
    this.userManager = new UserManager({
        core : this
    })

}
util.inherits(Service,EventEmitter);

module.exports = new Service();